package com.yc.music.service.service23;

import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.yc.music.common.context.YcContext;
import com.yc.music.common.util.RoomUtil;
import com.yc.music.mapper.dao.MusicianMapper231;
import com.yc.music.model.musician.MusicianVo;
/**
 * 
 * ClassName: MusiciansService <br/>
 * Function: TODO ADD FUNCTION. <br/>
 * Reason: TODO ADD REASON(可选). <br/>
 * date: 2016年11月21日 下午4:38:43 <br/>
 *
 * @author qinhaiguan
 * @version
 */
@Service
public class MusicianService231 {
	
	private static Logger logger = Logger.getLogger(MusicianService231.class);

	
	@Value("${Pic_QiLiu}")
	private String pIC_QiLiu;
	
	@Value("${Audio_QiLiu}")
	private String audio_QiLiu;
	
	
	@Autowired
	private MusicianMapper231 musicianMapper231;
	
	
	
	public Map<String,Object> getMoreMusicianList(Integer page,Map<String,Object> resultMap) throws Exception{
			int start =0,size=15;
			if(page!=null && page>1) {
				start=(page-1)*size;
			} 
			List<MusicianVo> musicianVoList=musicianMapper231.getMoreMusicianList(start, size);
			logger.info("获取更多音乐人数量："+musicianVoList.size());
			if (musicianVoList!=null&&musicianVoList.size()>0) {
				for (MusicianVo musicianVo : musicianVoList) {
					musicianVo.setHeadurl(RoomUtil.jointDomain(musicianVo.getHeadurl(),pIC_QiLiu));
				}
			}
			
			resultMap.put(YcContext.CODE, 200);
			resultMap.put(YcContext.MESSAGE, YcContext.EMPTY_STRING);
			resultMap.put(YcContext.DATA,musicianVoList);
			return resultMap;
		}
	
	}
